/*
 * Copyright (C) 2012 TopCoder Inc., All Rights Reserved.
 */
package com.ibm.dst.capacity.services;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

/**
 * <p>
 * Unit tests for class <code>XSeriesCapacityDataParsingException</code>.
 * </p>
 *
 * @author TCSDEVELOPER
 * @version 1.0
 */
public class XSeriesCapacityDataParsingExceptionTest {
    /**
     * <p>Represents the <code>Throwable</code> instance used to test against.</p>
     */
    private Throwable throwable;

    /**
     * <p>
     * Set up the test environment.
     * </p>
     *
     * @throws Exception
     *             To JUnit.
     */
    @Before
    public void setUp() throws Exception {
        throwable = new NullPointerException();
    }

    /**
     * <p>
     * Tear down the test environment.
     * </p>
     *
     * @throws Exception
     *             To JUnit.
     */
    @After
    public void tearDown() throws Exception {
        throwable = null;
    }

    /**
     * <p>
     * Accuracy test for the constructor
     * <code>XSeriesCapacityDataParsingException(String)</code> .<br>
     * Instance should be created successfully.
     * </p>
     */
    @Test
    public void testXSeriesCapacityDataParsingExceptionString() {
        XSeriesCapacityDataParsingException exception = new XSeriesCapacityDataParsingException("test");
        assertNotNull("Instance should be created", exception);
        assertTrue("XSeriesCapacityDataParsingException should subclass XSeriesReportServiceException",
                exception instanceof XSeriesReportServiceException);
        assertEquals("Return value should be 'test'", "test", exception
                .getMessage());
    }

    /**
     * <p>
     * Accuracy test for the constructor
     * <code>XSeriesCapacityDataParsingException(String, Throwable)</code> .<br>
     * Instance should be created successfully.
     * </p>
     */
    @Test
    public void testXSeriesCapacityDataParsingExceptionStringThrowable() {
        XSeriesCapacityDataParsingException exception = new XSeriesCapacityDataParsingException("test"
                , throwable);
        assertNotNull("Instance should be created", exception);
        assertTrue("XSeriesCapacityDataParsingException should subclass XSeriesReportServiceException",
                exception instanceof XSeriesReportServiceException);
        assertEquals("Return value should be 'test'", "test", exception
                .getMessage());
    }
}
